]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Don't iterate over all pages in page manager
authorDaniel García Moreno <daniel@endlessm.com>
Thu, 10 Sep 2020 14:30:15 +0000 (16:30 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 15 Sep 2020 09:33:53 +0000 (09:33 +0000)
In getAppPosition it's not needed to continue looking for an app in the
page manager if the app is found in a page.

This patch breaks the search loop just after the first ocurrence is
found.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1434

js/ui/appDisplay.js

index cecf6d185ba8c4577a2f43da14390dc058d8edf7..68fdbdd0e713c475f6b9ff9979c03e5588fce451 100644 (file)
@@ -851,11 +851,11 @@ var PageManager = GObject.registerClass({
         for (let pageIndex = 0; pageIndex < this._pages.length; pageIndex++) {
             const pageData = this._pages[pageIndex];
 
-            if (!(appId in pageData))
-                continue;
-
-            page = pageIndex;
-            position = pageData[appId].position;
+            if (appId in pageData) {
+                page = pageIndex;
+                position = pageData[appId].position;
+                break;
+            }
         }
 
         return [page, position];